<template>
  <div class="app">
    <el-config-provider :locale="zhCn">
      <app-header />
      <div class="container">
        <div class="box">
          <router-view></router-view>
        </div>
      </div>
    </el-config-provider>
  </div>
</template>

<script setup>
// 国际化配置
import { ElConfigProvider } from 'element-plus'
// import { getUserData } from "@/utils/index.js";
import { login } from '@/services/modules/home'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import Login from '@/pages/Login/index.vue'
import AppHeader from '@/components/app-header/app-header.vue'
import { onMounted, reactive } from 'vue'
import { useRoute } from 'vue-router'

import { localCache } from '@/utils/cache'
const route = useRoute()
const state = reactive({
  code: ''
})
function setToken() {
  return new Promise((resolve, reject) => {
    login({
      userName: 'admin',
      password: 'admin'
    }).then((res) => {
      if (res.code === 200) {
        localCache.setCache('login/token/base', res.data.token)
      }
    })
  })
}
onMounted(() => {
  // setToken()
  // getUserData()
})
</script>

<style lang="less" scoped>
.app {
  width: 100vw;
  height: 100vh;

  .container {
    height: calc(100vh - 65px);
    // background-image: url(@/assets/images/bg_img.png);
    background-repeat: no-repeat;
    background-size: 100% 100%;

    .box {
      width: 100%;
      height: 100%;
      padding: 12px;
      box-sizing: border-box;
    }
  }
}
</style>
